import request from '@/utils/request'
export const homesum = (data) =>
  request.get(`/ips/home/sumList?dimension=${data}`, {})
// 冻结
export const stockUseStatus = () => request.get('/ips/home/stockUseStatus')
// 待办信息
export const todo = () => request.get('/ips/home/todo')

// 分页查询仓库
export const warehouse = (data) =>
  request.get(
    `/api/warehouse/page?like_code=&like_name=&current=${data.page}&size=${data.pagesize}&descs=createTime`
  )

// 删除仓库
export const deleteFn = (data) =>
  request.delete(`/api/warehouse?ids[]=${data.id}`)

// 搜索

export const search = (data) =>
  request.get(
    `/api/warehouse/page?like_code=${data.like_code}&like_name=${data.like_name}&status=${data.status}&current=${data.page}&size=${data.pagesize}&descs=createTime`
  )
// 新增仓库
export const newAdd = (data) => request.post('/api/warehouse', data)
// Ck
export const CK = () => request.get('/api/codeFactory/next/CK')

// 编辑仓库
export const updata = (id) => request.get(`/api/warehouse/${id}`)
// 编辑库区
export const updata1 = (id) => request.get(`/api/area/${id}`)
// 库区
// 分页查询库区详细
export const pageDetail = (data) =>
  request.get(
    `/api/area/pageDetail?id=&name=&warehouseName=&size=${data.pagesize}&current=${data.page}`
  )
// KQ
export const KQ = () => request.get('/api/codeFactory/next/KQ')
// 搜索
export const searchArea = (data) =>
  request.get(
    `/api/area/pageDetail?id=&name=${data.name}&warehouseName=${data.warehouseName}&status=${data.status}&current=${data.page}&size=${data.pagesize}`
  )
// 查询仓库
export const list = () => request.get('/api/warehouse/list?status=1')
// 库位
export const location = (data) =>
  request.get(
    `/api/location/pageDetail?areaName=&name=&current=${data.page}&size=${data.pagesize}`
  )
// 改变状态
export const changeWare = (data) =>
  request.put('/api/warehouse', {
    ...data
  })
export const changeWare1 = (data) =>
  request.put('/api/area', {
    ...data
  })
export const changeWare2 = (data) =>
  request.put('/api/location', {
    ...data
  })
// 新增库区
export const area = (data) => request.post('/api/area', data)
export const areaupdate = (data) => request.put('/api/area', data)
